﻿/**
* jQuery twiLoadingMask plugin
* @author: feitianxinhong  http://xuzhihong1987.blog.163.com/
* @version 1.0
* @create date:2013-08-20
* @copyright (c) 2013 feitianxinhong/tyingsoft/twilight  http://www.tyingsoft.com
* @example Visit 
*/
(function () {
    var global = this;
    if (typeof Twi === 'undefined') {
        global.Twi = {};
    }
    Twi.global = global;
    Twi.LoadingMask = function (config) {
        config = config || {};
        this.msg = config.msg || "正在加载数据......";
        this.id = "TwiLoadingMask" + Math.floor(100000 * Math.random()); //随机ID     
    }
    Twi.LoadingMask.prototype.show = function () {
        var html = '<div id="' + this.id + '">';
        html += '<div class="twiLoadingMaskBg"></div>';
        html += '<div class="twiLoadingMaskCnt"><span type="twiLoadingMaskMsg">' + this.msg + '</span></div>';
        html += '</div>';
        $('body').append(html);
    }
    Twi.LoadingMask.prototype.hide = function () {
        $('#' + this.id).remove();
    }
})();

